Repository navigation
Conversation
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
|
@codex review |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
Codex Review: Didn't find any major issues. What shall we delve into next? ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@ZhenjaHorbach Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
| // Mirror optimisticType logic from createReportField: if user enters a formula | ||
| // while type is Text, automatically switch the type to Formula in the form, otherwise back to Text. | ||
| const isFormula = hasFormulaPartsInInitialValue(initialValue); | ||
| if (isFormula) { |
There was a problem hiding this comment.
❌ CONSISTENCY-3 (docs)
The if/else branches in handleOnValueCommitted are nearly identical -- both call setDraftValues with the same form key and initialValue, differing only in the TYPE field. This duplication can be consolidated into a single call.
Simplify to:
const handleOnValueCommitted = (initialValue: string) => {
const isFormula = hasFormulaPartsInInitialValue(initialValue);
setDraftValues(ONYXKEYS.FORMS.WORKSPACE_REPORT_FIELDS_FORM, {
[INPUT_IDS.TYPE]: isFormula ? CONST.REPORT_FIELD_TYPES.FORMULA : CONST.REPORT_FIELD_TYPES.TEXT,
[INPUT_IDS.INITIAL_VALUE]: initialValue,
});
};Reviewed at: d48c287 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
There was a problem hiding this comment.
Which is a lot less readable. The if/else branch is explicit - it's easy to read on the first pass.
I don't have to go back to the ternary and figure out what's happening there
|
No product review needed |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp2026-06-02.09.52.26.movAndroid: mWeb Chrome2026-06-02.09.55.10.moviOS: HybridApp2026-06-02.09.45.21.moviOS: mWeb Safari2026-06-02.09.46.59.movMacOS: Chrome / Safari2026-06-15.11.12.34.mov |
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.9-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 No help site changes are required for this PR. Why: This PR is an internal navigation/animation refactor. It migrates the report field Type selector from a I checked the one relevant article — Enable Report Fields — and its Create New Report Fields steps (open Add Field, enter Name, choose a Field Type, Save) remain accurate. The picker still opens from the Type row and offers the same options; only the presentation/animation changed. Behavior changes reviewed (none documented)The PR notes three minor UX improvements, none of which are described on the help site, so no edits are needed:
Pre-existing doc gap (out of scope for this PR)The article lists Text, Date, and List as field types but not Formula, which the app also supports. This gap predates this PR (Formula is existing behavior, not introduced here), so I did not open a docs PR for it. Worth tracking separately if you'd like it documented. @sharabai, since no documentation update is required, I did not open a help site PR. If you'd prefer I document the pre-existing Formula field type gap noted above, reply with |
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.4.9-0 🚀
|
Explanation of Change
Note
Reapplies the previous PR that was reverted because of a regression
Migrates
TypeSelectorModal(react-native-modal) to a@react-navigationRHP screen (TypeSelectorPage) for consistent right-to-left animations.TypeSelectoris now aMenuItemWithTopDescriptionthat navigates to the new screen; selection writestype+ computedinitialValueto the form draft. A newFormValueWatcherprimitive preserves the originalresetFormsemantics (clears errors /touchedflags) without leaking effects intoFormProvider.Fixed Issues
$ #90473
PROPOSAL:
Tests
{report:id}for Formula, hidden (and replaced by the List values row) for List.resetFormviaFormValueWatcher).{report:total}on the sub-screen and tap Save to return. The form auto-switches Type to Formula (existing behavior ofhandleOnValueCommitted). Re-open the Type picker and verify it highlights Formula (the live type), not the previous Text.Important
Behavior changes were introduced (improvements over old ones):
Regression tests for the behavior changes above
{report:id}). Hard-reload the browser tab (Cmd+R / refresh). After the page comes back, confirm Name still reads "My field", Type still shows Formula, and Initial value still shows{report:id}— the in-progress draft survives the reload.Add field → Type selectoris rebuilt under the modal on refresh.Offline tests
Same as tests.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
ios.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari